<?php
namespace app\model\controller; 
use think\Model;
use think\Db; 
class Index extends Model{

    public static function carInfo()
    {
        $resAll = array();
        $res = Db::name('car_brand_models_dict')->alias('a')
            ->join('car_brand_dict b', 'a.brand_id=b.id')
            ->field('a.names,b.first_letter,b.name')
            ->order('b.first_letter asc')


            ->select();
 		// $resA = ['A','B','C','D','E','F','G','H','I','G','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
        foreach ($res as $key => $value) {
            $resAll[$value['first_letter']][$value['first_letter']][$value['name']][$value['names']] = $value['names'];

        }


        return $resAll;
    }
}